/*
  LinPVR - Linux Personal Video Recorder
  Copyright (C) 2006 Kamil Pawlowski <kamilpe@gmail.com>

  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either version 2
  of the License, or (at your option) any later version.
  
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
  
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
*/
#ifndef _MAIN_H_
#define _MAIN_H_

#include <glade/glade.h>
#include "config.h"
#include "gui.h"
#include "video.h"
#include "audio.h"
#include "capture.h"
#include "ogg_enc.h"

#define VIDEO_WIDTH   384
#define VIDEO_HEIGHT  288

/*
  Program can be on some modes.
  NO_DEVICE - video device has not been opened
  IDLE - video device have open but program nothing do
  TV, RECORD, PLAY ... this is functional modes
 */

#define MODE_NO_DEVICE -1
#define MODE_IDLE       0
#define MODE_TV         1
#define MODE_RECORD     2
#define MODE_PLAY       3

typedef struct linpvr_s {
  int         mode;
  config_t    config;
  GladeXML   *glade;
  
  videodev_t  video;
  audiodev_t  audio;
  
  capture_t   capture;
  preview_t   preview;
  ogg_enc_t   ogg_enc;
} linpvr_t;

void linpvr_init(linpvr_t *linpvr);
void linpvr_uninit(linpvr_t *linpvr);
void linpvr_switch_mode(linpvr_t *linpvr, int mode);
void linpvr_main_quit();

#endif
